package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_user_operation_log")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserOperationLog {
    @Id
    private Integer id;

    /**
     * 用户角色
     */
    private String role;

    /**
     * 用户名
     */
    private String username;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * IP地址
     */
    private String ip;


    /**
     * 操作-类型
     */
    private String type;

    /**
     * 操作-数据
     */
    private String params;

    /**
     * 操作-描述
     */
    private String content;


    /**
     * 是否推送到ai-server: 0.否 1.是
     */
    @Column(name = "is_push_ai_server")
    private Integer isPushAiServer;

    /**
     * 操作-文件
     */
    private String file;

    /**
     * 操作时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createdTime;
}